package org.assistant.common.jdbc.core;

public interface InterruptibleBatchPreparedStatementSetter extends
		BatchPreparedStatementSetter {
	/**
	 * Return whether the batch is complete, that is, whether there were no
	 * additional values added during the last <code>setValues</code> call.
	 * <p>
	 * <b>NOTE:</b> If this method returns <code>true</code>, any parameters
	 * that might have been set during the last <code>setValues</code> call will
	 * be ignored! Make sure that you set a corresponding internal flag if you
	 * detect exhaustion <i>at the beginning</i> of your <code>setValues</code>
	 * implementation, letting this method return <code>true</code> based on the
	 * flag.
	 * 
	 * @param i
	 *            index of the statement we're issuing in the batch, starting
	 *            from 0
	 * @return whether the batch is already exhausted
	 * @see #setValues
	 * @see org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter#setValuesIfAvailable
	 */
	boolean isBatchExhausted(int i);
}
